package com.kuang.controller;

import com.kuang.dao.impl.EmployeeDaoImpl;
import com.kuang.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Collection;

@Controller
public class IndexController {

    @Autowired
    EmployeeDaoImpl employeeDaoImpl;

    /**
     * 首页
     * @param model
     * @return
     */
    @RequestMapping(value = "/")
    public String indexShow(Model model) {
        Collection<Employee> allEmplyee = employeeDaoImpl.getAll();
        model.addAttribute("allEmpls", allEmplyee);
        return "index";
    }

}
